<template>
    <div class="carousel">
        <el-carousel trigger="click">
            <el-carousel-item v-for="(item,i) in banner" :key="i">
                <a target="_blank" :href="item.NavigateUrl || 'javascript:;'">
                    <img :src="$store.state.port.ossPath+item.FileUrl" alt="" :title="item.AdvertisementName">
                </a>
            </el-carousel-item>
        </el-carousel>
    </div>
</template>

<script>
export default {
    props: ['carouselList'],
    data() {
        return {
            banner: []
        }
    },
    methods: {
        getData() {
            var url = "/Advertise?ID="+121;
            this.$axios.get(url).then(res => {
                // console.log(res.data)
                this.banner = res.data.Advertisements
            })
        }
    },
    mounted() {
        console.log(this.carouselList)
        this.banner = this.carouselList.Advertisements
        // this.getData();
    }
}
</script>

<style lang="less" scoped>
.carousel /deep/ .el-carousel__container{
    height: 100%;
}
.el-carousel{
    width: 930px;
    height: 100%;
    border-radius:20px;
}
.el-carousel img{
    width: 100%;
    height: 100%;
}
</style>
